package com.lenovo.spider.process.parser;

import cn.hutool.core.util.RandomUtil;
import com.lenovo.spider.domain.SiteConfig;
import com.lenovo.spider.domain.Task;
import lombok.extern.slf4j.Slf4j;

import static cn.hutool.core.thread.ThreadUtil.safeSleep;

/**
 * @author <a href="mailto:liuhan3@lenovo.com">HanL(liuhan3)</a>
 * on 2018/3/27 15:34
 */
@Slf4j
public class DefaultPageParser extends PageParser {

    @Override
    public SiteConfig getSiteConfig() {
        return SiteConfig.builder().build();
    }

    @Override
    protected Task doParser(Task task) {
        log.info("解析：{}", task);
        safeSleep(RandomUtil.randomInt(1000, 6000));
        return task;
    }
}
